**********************
****** TABLE 1 *******
**********************;


// The following commands reproduce the results in Table 1 in the TRN blog
clear
set obs 10000
set seed 1
gen x1 = rnormal()
gen x2 = 2*rnormal()
gen y1 = x1 + rnormal()
gen y2 = x2 + rnormal()
summ y1
gen y1std = (y1-r(mean))/r(sd)
summ x1
gen x1std = (x1-r(mean))/r(sd)
reg y1 x1
reg y2 x2
reg y1 x1, beta
//reg y1std x1std
reg y2 x2, beta
importance y1, clear export x(x1)
importance y2, clear export x(x2)


**********************
****** TABLE 2 *******
**********************;

// This section reproduces results for the Ceteris paribus and Non-ceteris paribus 
// importance measures
// NOTE: The importance command needs to be downloaded from the author's website: 
// https://oliviersterck.wordpress.com/

clear
global geo malfal tmean  pmean rugged  dist_coast   soil tropical  desert  lnabslat   diamonds opec 
global history ln_yst_aa ln_slave_exports_area 
global population eth_fragm    european_descent
global linear  $geo $history  $population
global group1 pdiv_aa  pdiv_aasq
global group2 wb_eap  wb_lac wb_mena wb_nam wb_sas wb_ssa // wb_eca  
global group3 pcatholic pmuslim pother //pprotest
global group4 legor_gbr legor_soc legor_deu  legor_sca // legor_fra 


use "\\file\UsersW$\wrr15\Home\My Documents\My Files\REPLICATION WEBSITE\STERCK FILES\replication files_data.dta", clear
// The following command reproduces the results for Table 3 in the TRN blog
importance lnrgdppcch2000 , clear export vce(robust) x(($linear) ($group1) ($group2)($group3)($group4))

// The following command reproduces the results for Table 2 in Sterck's paper, "On the Measurement of Importance"
importance lnrgdppcch2000 , clear export vce(robust) x($linear ($group1) ($group2)($group3)($group4))
